<?php
/**
 * Created by PhpStorm.
 * User: fress
 * Date: 15/4/1
 * Time: 22:54
 */
ini_set('display_errors','on');//开启或关闭PHP异常信息
date_default_timezone_set('Asia/Shanghai');
error_reporting(E_ALL);//异常级别设置

//系统设置不可替换的静态配置
define('FD_DS', DIRECTORY_SEPARATOR);//定制目录符合
define('XD_MODULE',1);
define('SYS_ROOTDIR',dirname(__FILE__).FD_DS);
define('SYS_LOGDIR',SYS_ROOTDIR.'logs'.FD_DS);//日志目录
define('SYS_CACHE',SYS_ROOTDIR.'cache'.FD_DS);//缓存目录
define('SYS_PLUGIN',SYS_ROOTDIR.'plugin'.FD_DS);//第三方组件
define('SYS_LIBDIR',SYS_ROOTDIR.'fend'.FD_DS);//框架核心文件目录
define('SYS_SOCKET',SYS_ROOTDIR.'appsocket'.FD_DS);//socket业务代码层
define('SYS_CONTROLLER',SYS_ROOTDIR.'application'.FD_DS);//http业务代码层
define('SYS_VIEW',SYS_ROOTDIR.'view'.FD_DS);//http业务模板层

require_once(SYS_LIBDIR.'fend.php');

$_servername    = isset($_SERVER['HTTP_HOST'])?$_SERVER['HTTP_HOST']:'';
$_domain        = explode('.',$_servername);
if(count($_domain)>=3){
    unset($_domain[0]);
}
$_domain    =   join('.',$_domain);
$_configname=   'cfg_'.$_domain.'.php';
$_domain    =   '.'.$_domain;
$_fccfg  = array(
    'froot' =>SYS_CACHE,//缓存跟目录
    'type'  =>0,       //采用什么方式储存
    'fmod'  =>0755,    //写入文件的权限
    'fext'  =>'.php',  //写入文件的后缀
    'fdef'  =>array(), //默认结果集合
);
if(!empty($_GET['debug'])){
    define('DEBUG',1);

}
Fend_Func::load('FendTimer','FendString','FendArray','FendHttp','FendComposer');
foreach (glob(SYS_ROOTDIR."conf/*.php") as $filename) {
    require_once($filename);
}
